<!-- $Id: wxch_menu.html  2013-11-16 10:30:26Z djks $ -->
{include file="wxch_pageheader.htm"}
{insert_scripts files="../data/static/js/utils.js,./js/selectzone.js,./js/colorselector.js"}

<script type="text/javascript" src="../data/static/js/calendar.php?lang={$cfg_lang}"></script>

<link href="../data/static/js/calendar/calendar.css" rel="stylesheet" type="text/css" />



{if $warning}

<ul style="padding:0; margin: 0; list-style-type:none; color: #CC0000;">

    <li style="border: 1px solid #CC0000; background: #FFFFCC; padding: 10px; margin-bottom: 5px;" >{$warning}</li>

</ul>

{/if}



<div class="tab-div">

<div id="tabbar-div">

    <p>

        <span class="tab-front" id="one-table">菜单一</span>

        <span class="tab-back" id="two-table">菜单二</span>

        <span class="tab-back" id="three-table">菜单三</span>

    </p>

</div>



<!-- tab body -->

<div id="tabbody-div">

<form enctype="multipart/form-data" action="" method="post" name="theForm" >

<!-- 通用信息 -->

<table width="50%" id="one-table" align="center">

    <tr>

            <td class="label">级别&nbsp;&nbsp;</td>

            <td><strong>类型</strong></td>

            <td><strong>名称</strong></td>

            <td><strong>值</strong></td>

    </tr>

    <tr>

        <td class="label">一级菜单：</td>

        <td>

            <select name="first_type[]">

                    <option value="click"{if $data.first.0.menu_type eq click}selected{/if} >click</option>

                    <option value="view" {if $data.first.0.menu_type eq view}selected{/if} >view</option>

            </select>  

        </td>

        <td>
                <label><input type="text" name="first[]" value="{$data.first.0.name}" size="8"  style="min-width:0;"/></label>

        </td>

        <td>
                <label><input type="text" name="first_value[]" value="{$data.first.0.value}" size="8"  style="min-width:0;"/></label>

        </td>

    </tr>

    {foreach from=$data.second1 item=items}

    <tr>

        <td class="label">二级菜单{$items.num}：</td>

        <td>

            <select name="menu_type1[]">

                    <option value="click" {if $items.menu_type eq click}selected{/if} >click</option>

                    <option value="view" {if $items.menu_type eq view}selected{/if} >view</option>

            </select>  

        </td>

        <td>

                <label><input type="text" name="second1[]" value="{$items.name}" size="8"  style="min-width:0;"/></label>

        </td>

        <td>

                <label><input type="text" name="value1[]" value="{$items.value}" size="8"  style="min-width:0;"/></label>

        </td>

    </tr>

    {/foreach}

</table>

<table width="50%" id="two-table" align="center" style="display:none">

    <tr>

            <td class="label">级别&nbsp;&nbsp;</td>

            <td><strong>类型</strong></td>

            <td><strong>名称</strong></td>

            <td><strong>值</strong></td>

    </tr>

    <tr>

        <td class="label">一级菜单：</td>

        <td>

            <select name="first_type[]">

                    <option value="click"{if $data.first.1.menu_type eq click}selected{/if} >click</option>

                    <option value="view" {if $data.first.1.menu_type eq view}selected{/if} >view</option>

            </select>  

        </td>

        <td>

                <label><input type="text" name="first[]" value="{$data.first.1.name}" size="8"  style="min-width:0;"/></label>

        </td>

        <td>

                <label><input type="text" name="first_value[]" value="{$data.first.1.value}" size="8"  style="min-width:0;"/></label>

        </td>

    </tr>

    {foreach from=$data.second2 item=items}

    <tr>

        <td class="label">二级菜单{$items.num}：</td>

        <td>

            <select name="menu_type2[]">

                    <option value="click" {if $items.menu_type eq click}selected{/if} >click</option>

                    <option value="view" {if $items.menu_type eq view}selected{/if} >view</option>

            </select>  

        </td>

        <td>

                <label><input type="text" name="second2[]" value="{$items.name}" size="8"  style="min-width:0;"/></label>

        </td>

        <td>

                <label><input type="text" name="value2[]" value="{$items.value}" size="8"  style="min-width:0;"/></label>

        </td>

    </tr>

    {/foreach}

    

</table>

<table width="50%" id="three-table" align="center" style="display:none">

    <tr>

            <td class="label">级别&nbsp;&nbsp;</td>

            <td><strong>类型</strong></td>

            <td><strong>名称</strong></td>

            <td><strong>值</strong></td>

    </tr>

    <tr>

        <td class="label">一级菜单：</td>

        <td>

            <select name="first_type[]">

                    <option value="click" {if $items.menu_type eq click}selected{/if} >click</option>

                    <option value="view" {if $items.menu_type eq view}selected{/if} >view</option>

            </select>  

        </td>

        <td>

                <label><input type="text" name="first[]" value="{$data.first.2.name}" size="8"  style="min-width:0;"/></label>

        </td>

        <td>

                <label><input type="text" name="first_value[]" value="{$data.first.2.value}" size="8"  style="min-width:0;"/></label>

        </td>

    </tr>

    {foreach from=$data.second3 item=items}

    <tr>

        <td class="label">二级菜单{$items.num}：</td>

        <td>

            <select name="menu_type3[]">

                    <option value="click" {if $items.menu_type eq click}selected{/if} >click</option>

                    <option value="view" {if $items.menu_type eq view}selected{/if} >view</option>

            </select>  

        </td>

        <td>

                <label><input type="text" name="second3[]" value="{$items.name}" size="8"  style="min-width:0;"/></label>

        </td>

        <td>

                <label><input type="text" name="value3[]" value="{$items.value}" size="8"  style="min-width:0;"/></label>

        </td>

    </tr>

    {/foreach}

</table>



<div class="button-div">

    <input type="submit" value="{$lang.button_submit}" class="button" />

    <input type="reset" value="{$lang.button_reset}" class="button" />

</div>

<input type="hidden" name="act" value="{$form_act}" />

</form>

</div>

</div>

<!-- end goods form -->

{insert_scripts files="./js/validator.js,./js/tab.js"}



<script language="JavaScript">



var articleId = {$article.article_id|default:0};

var elements  = document.forms['theForm'].elements;

var sz        = new SelectZone(1, elements['source_select'], elements['target_select'], '');



{literal}

onload = function()

{

  // 开始检查订单

  startCheckOrder();

}



function validate()

{

  var validator = new Validator('theForm');

  validator.required('title', no_title);

{/literal}

{if $article.cat_id >= 0}

  validator.isNullOption('article_cat',no_cat);

{/if}

{literal}



  return validator.passed();

}



document.getElementById("tabbar-div").onmouseover = function(e)

{

    var obj = Utils.srcElement(e);



    if (obj.className == "tab-back")

    {

        obj.className = "tab-hover";

    }

}



document.getElementById("tabbar-div").onmouseout = function(e)

{

    var obj = Utils.srcElement(e);



    if (obj.className == "tab-hover")

    {

        obj.className = "tab-back";

    }

}



document.getElementById("tabbar-div").onclick = function(e)

{

    var obj = Utils.srcElement(e);



    if (obj.className == "tab-front")

    {

        return;

    }

    else

    {

        objTable = obj.id.substring(0, obj.id.lastIndexOf("-")) + "-table";



        var tables = document.getElementsByTagName("table");

        var spans  = document.getElementsByTagName("span");



        for (i = 0; i < tables.length; i++)

        {

            if (tables[i].id == objTable)

            {

                tables[i].style.display = (Browser.isIE) ? "block" : "table";

            }

            else

            {

                tables[i].style.display = "none";

            }

        }

        for (i = 0; spans.length; i++)

        {

            if (spans[i].className == "tab-front")

            {

                spans[i].className = "tab-back";

                obj.className = "tab-front";

                break;

            }

        }

    }

}



function showNotice(objId)

{

    var obj = document.getElementById(objId);



    if (obj)

    {

        if (obj.style.display != "block")

        {

            obj.style.display = "block";

        }

        else

        {

            obj.style.display = "none";

        }

    }

}



{/literal}

</script>

{include file="wxch_pagefooter.htm"}

